package com.testplatform.aitestplatform.service.impl;

import java.util.Arrays;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.testplatform.aitestplatform.mapper.TestCaseStepsMapper;
import com.testplatform.aitestplatform.domain.TestCaseSteps;
import com.testplatform.aitestplatform.service.ITestCaseStepsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * 测试用例步骤明细Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-10-24
 */
@Service
public class TestCaseStepsServiceImpl extends ServiceImpl<TestCaseStepsMapper, TestCaseSteps> implements ITestCaseStepsService
{
    @Autowired
    private TestCaseStepsMapper testCaseStepsMapper;

    /**
     * 查询测试用例步骤明细
     * 
     * @param id 测试用例步骤明细主键
     * @return 测试用例步骤明细
     */
    @Override
    public TestCaseSteps selectTestCaseStepsById(Long id)
    {
        return getById(id);
    }

    /**
     * 查询测试用例步骤明细列表
     * 
     * @param testCaseSteps 测试用例步骤明细
     * @return 测试用例步骤明细
     */
    @Override
    public List<TestCaseSteps> selectTestCaseStepsList(TestCaseSteps testCaseSteps)
    {
        return testCaseStepsMapper.selectTestCaseStepsList(testCaseSteps);
    }

    /**
     * 新增测试用例步骤明细
     * 
     * @param testCaseSteps 测试用例步骤明细
     * @return 结果
     */
    @Override
    public int insertTestCaseSteps(TestCaseSteps testCaseSteps)
    {
        return save(testCaseSteps) ? 1 : 0;
    }

    /**
     * 修改测试用例步骤明细
     * 
     * @param testCaseSteps 测试用例步骤明细
     * @return 结果
     */
    @Override
    public int updateTestCaseSteps(TestCaseSteps testCaseSteps)
    {
        return updateById(testCaseSteps) ? 1 : 0;
    }

    /**
     * 批量删除测试用例步骤明细
     * 
     * @param ids 需要删除的测试用例步骤明细主键
     * @return 结果
     */
    @Override
    public int deleteTestCaseStepsByIds(Long[] ids)
    {
        return removeByIds(Arrays.asList(ids)) ? 1 : 0;
    }

    /**
     * 删除测试用例步骤明细信息
     * 
     * @param id 测试用例步骤明细主键
     * @return 结果
     */
    @Override
    public int deleteTestCaseStepsById(Long id)
    {
        return removeById(id) ? 1 : 0;
    }
}
